package com.joinway.extension.socket.serializer;

import org.apache.commons.lang3.StringUtils;


public class StringSerializer implements ISegmentSerializer<String> {

	public final static StringSerializer Instance = new StringSerializer();
	
	@Override
	public String deserialize(byte...bytes) {
		return StringUtils.trim(new String(bytes));
	}

	@Override
	public byte[] serialize(String data) {
		return data.getBytes();
	}

}
